package cn.edu.sdjzu.xg.bysj.service;

import cn.edu.sdjzu.xg.bysj.dao.GraduateProjectTruenessDao;
import cn.edu.sdjzu.xg.bysj.domain.GraduateProjectTrueness;
import util.Condition;
import util.JdbcHelper;
import util.Pagination;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Collection;
import java.util.List;

public class GraduateProjectTruenessService {
    private static GraduateProjectTruenessDao graduateProjectTruenessDao =
            GraduateProjectTruenessDao.getInstance();
    private static GraduateProjectTruenessService graduateProjectStatusService =
            new GraduateProjectTruenessService();

    public static GraduateProjectTruenessService getInstance() {
        return graduateProjectStatusService;
    }

    public GraduateProjectTrueness find(Integer id) throws SQLException {
        Connection connection = JdbcHelper.getConn();
        GraduateProjectTrueness graduateProjectTrueness =
                graduateProjectTruenessDao.find(id, connection);
        JdbcHelper.close(connection);
        return graduateProjectTrueness;
    }

    public Collection<GraduateProjectTrueness> findAll()
            throws SQLException {
        Connection connection = JdbcHelper.getConn();
        Collection<GraduateProjectTrueness> graduateProjectTrueness =
                graduateProjectTruenessDao.findAll(connection);
        JdbcHelper.close(connection);
        return graduateProjectTrueness;
    }
}
